package com.xiye.system.service.department.impl;

import com.xiye.system.service.department.DepartmentService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import com.xiye.system.dao.DaoSupport;
import com.xiye.common.entity.PageData;
import org.springframework.transaction.annotation.Transactional;

/**
 * @author 西野
 * @version V1.0
 * @title DepartmentServiceImpl.java
 * @package com.xiye.system.service.department.impl
 * @description 组织数据权限表
 * @date 2018-07-12
 */
@Transactional
@Service("departmentService")
public class DepartmentServiceImpl implements DepartmentService {

    @Autowired
    private DaoSupport dao;

    /*
     * @Author 西野
     * @Date 2018-06-22 11:06:06
     * @Description 新增
     * @Param [pd]
     * @Return void
     */
    public void save(PageData pd) {
        dao.save("DepatmentMapper.save", pd);
    }

    /*
     * @Author 西野
     * @Date 2018-06-22 11:06:06
     * @Description 修改
     * @Param [pd]
     * @Return void
     */
    public void edit(PageData pd) {
        dao.update("DepatmentMapper.edit", pd);
    }

    /*
     * @Author 西野
     * @Date 2018-06-22 11:06:06
     * @Description 通过id获取数据
     * @Param [pd]
     * @Return com.xiye.common.entity.PageData
     */
    public PageData findById(PageData pd) {
        return (PageData) dao.findForObject("DepatmentMapper.findById", pd);
    }

    /*
     * @Author 西野
     * @Date 2018-06-22 11:06:06
     * @Description 取出某用户的组织数据权限
     * @Param [USERNAME]
     * @Return com.xiye.common.entity.PageData
     */
    public PageData getDEPARTMENT_IDS(String USERNAME) {
        return (PageData) dao.findForObject("DepatmentMapper.getDEPARTMENT_IDS", USERNAME);
    }

}

